Getting Column Name when blank, and from ADXL

I built an Layout DXL that recursively returns Attributes from in-linked Objects, based on the name of the Column the code appears in (plus a suffix phrase, " Rollup"). So, if you want to see the values for Attribute "Object Text" from all in-linked modules, you would name the Column "Object Text Rollup", and put the DXL code in. If Module B Object 2 and Module C Object 3 linked to this Object, the cell in Column "Object Text Rollup" might read:

[<-B2] Blah blah blah.

[<-C3] This is text in Module C.

If the user misnames the Column ("Dumb Name That Doesn't End In Rollup Unfortunately"), a default Attribute is returned.

I have two problems:


1. If the Column name is blank, I get an odd error. It complains of an uninitiated variable "i" - but none such is in the code. To get the Column name I use

strColumnName = title(currentColumn())

I check to see if length(strColumnName) > 0, and I even tried protecting the assignment with

    if (!null title(currentColumn()))
    {
        strColumnName = title(currentColumn())
    }

I still get the error. :(

 

2. I would like to implement this as Attribute DXL, but it just errors out when I converted it using the usual Tools > Support Tools > Convert Layout DXL to Attribute DXL.

 

The full code is attached.

Any ideas?


JoeMarfice - Tue Jan 22 23:18:24 EST 2019

Re: Getting Column Name when blank, and from ADXL
llandale - Thu Jan 31 19:21:33 EST 2019

the "currentColulmn()" command only works in layouts.  If you
"Column c = currentColumn; print "c null: " (null c) "\n"
You will see it null in your attr-DXL.
I didn't do this, but you could browse through all the columns current displayed, get their "attribute" name, and if it is your attr DXL then get the column title from that column.
Something like this:
Module mod = current

Column c

for c in mod do

{  if (attribute(c)) == "whatever I called it.dxl")

   Title = Title(c)

   break

}

I've been using the name of the attr-DXL to drive specifics of this sort of code.  Generic Attr-DXL/Layout will need something like these:
at the top:
if (null attrDXLName()) //
then Layout: get title from currentColumn()

else AttrDXL: get title from currrentColuimn
and at the bottom
if (null attrDXLName()) //

then Layout.  DisplayRich(results)

else AttrDXL: obj.attrDXLName = richText(results)

I've been gone for a while, maybe I need to learn how to use the forums.

-Louie